package com.huage_09.lesson_01;

public class FlyableDemo {
    public static void main(String[] args) {
        //匿名内部类
        useFlyable(new Flyable() {
            @Override
            public void fly(String s) {
                System.out.println(s);
                System.out.println("飞机飞在天上");
            }
        });
        System.out.println("--------");
        //Lambda
        useFlyable((String s)->{//实现类重写方法代码块
            System.out.println(s);
            System.out.println("飞机飞在天上");
        });
    }
    public static void useFlyable(Flyable f){
        f.fly("鸟会飞了");
    }
}
